﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
using DepartmentWork.Migrator.Data;

namespace DepartmentWork.Migrator
{
    public class DepartmentWorkDbContext : DbContext
    {

        public DepartmentWorkDbContext()
            : base("DepartmentWorkConn")
        {
            Database.SetInitializer<DepartmentWorkDbContext>
                (new CreateDatabaseIfNotExists<DepartmentWorkDbContext>());
            // (new DropCreateDatabaseIfModelChanges<DepartmentWorkDbContext>());
            // (new DropCreateDatabaseAlways<DepartmentWorkDbContext>());

            this.Configuration.AutoDetectChangesEnabled = false;

            this.Configuration.LazyLoadingEnabled = false;
        }

        public DbSet<PROJECT_DEVELOP> Projects_Develop { get; set; }

        public DbSet<PROJECT_DEVELOP_BUG> Project_Develop_Bugs { get; set; }

        public DbSet<PROJECT_DEVELOP_TASK> Project_Develop_Tasks { get; set; }

        public DbSet<PROJECT_DEVELOP_TASKBOOK> Project_Develop_Taskbooks { get; set; }

        public DbSet<PROJECT_DEVELOP_USER> Project_Develop_Users { get; set; }

        public DbSet<TEAMSPACE> Teamspaces { get; set; }

        public DbSet<USER_INFO> UserInfos { get; set; }

        public DbSet<USER_TEAMSAPCE> UserTeamspace { get; set; }

        public DbSet<PROJECT_DEVELOP_DOCUMENT> ProjectDevelopDocuments { get; set; }

        //public DbSet<PROJECT_DEVELOP_DOCUMENT_TYPE> ProjectDevelopDocumentTypes { get; set; }

        public DbSet<FILEINFO> Fileinfos { get; set; }

        public DbSet<ROLE_INFO> RoleInfos { get; set; }

        public DbSet<PROJECT_DESK_LEAVE> Project_Desk_Leave { get; set; }

        public DbSet<PROJECT_DESK_WORK> Project_Desk_Work { get; set; }

        public DbSet<PROJECT_DESK_WORKTIME> Project_Desk_WorkTime { get; set; }

        public DbSet<MENU> Menu { get; set; }

        public DbSet<MENU_ROLE> Menu_Role { get; set; }

        public DbSet<PROJECT_MANAGEMENT> Project_Management { get; set; }

        public DbSet<PROJECT_WORKRECORD> Project_Workrecored { get; set; }

        public DbSet<PROJECT_MAINTENANCE_APPOPS> Project_Maintenance_Appops { get; set; }

        public DbSet<PROJECT_MAINTENANCE_DOCUMENT> Project_Maintenance_Document { get; set; }

        public DbSet<PROJECT_MAINTENANCE_RECORD> Project_Maintenance_Record { get; set; }


        public DbSet<PROJECT_MAINTENANCE_APPOPS_USER> Project_Appops_User { get; set; }

        public DbSet<PROJECT_DESK_WORK_JOBLOGGING> Project_Desk_Joblogging { get; set; }

        public DbSet<TEAMTRAIN> Team_Train { get; set; }

        public DbSet<EMP_AUTHORITY> Emp_Authority { get; set; }

        public DbSet<AUTHORITY_ROLE> Authority_Role { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
        }
    }
}
